
import BaseMixin from '@/views/mixin.vue'
import { HttpAbnormalBill } from "@/service/api/views";
import comRefreeze from './refreeze'

import compSearch from './search';
import { mapState } from 'vuex'
export default {
    mixins: [BaseMixin],
    components: {
        compSearch,
        comRefreeze,
    },
    data() {
        return {
            title: "异常单据"
        };
    },
    methods: {
        httpList: HttpAbnormalBill,
        handleOperate(params='', type) {
            this.operate = {};
            switch (type) {
                case 'error': {
                    this.checkedId = !params ? this.checkedId : [params];
                    if (this.checkedId.length == 0) {
                        this.$Message.warning(this.$ct('global.common.choose_one',{defaultValue:'请选择至少一条数据'}));
                        return;
                    }
                    this.operate = {
                        title: '异常处理',
                        show:true,
                        width:600,
                        component: "comRefreeze",
                        activeids:this.checkedId,
                    }
                }; break;
            }
        },
    },
    computed: {
        ...mapState(['systemlist']),
        columns() {
            return [{
                // title: "#",
                type: "selection",
                width:60,
            }, {
                title: "账户组织",
                key: "organizationId",
                sortable: true,
                render: (h, { row }) => {
                    const id = row.organizationId,
                        data = this.systemlist.find((item) => {
                            return item.id === id
                        })||{};
                    return <div>{data.name}</div>
                }
            }, {
                title: "tracking No",
                key: "trackingNo",
                sortable: true,
            },
             {
                title: "冻结金额（USD）",
                key: "amount",
                sortable: true,
            }, 
            {
                title: "冻结时间",
                key: "createdAt",
                sortable: true,
            },];
        },

    }
};
